sequenceDiagram
participant StorageMiningSubsystem
participant StorageMinerActor
participant StorageMarketActor
StorageMiningSubsystem -->+ StorageMarketActor: PublishStorageDeals
StorageMarketActor -->> StorageMarketActor: _validateNewStorageDeal
StorageMarketActor -->> StorageMarketActor: _assertValidClienSignature
StorageMarketActor -->> StorageMarketActor: _assertValidDealTimingAtPublish
StorageMarketActor -->> StorageMarketActor: _assertValidDealMinimum
StorageMarketActor -->> StorageMarketActor: _assertSufficientBalanceAvailableForDeal
StorageMarketActor -->> StorageMarketActor: _lockFundsForStorageDeal
StorageMarketActor --> StorageMarketActor: _generateStorageDealID
StorageMarketActor -->- StorageMiningSubsystem: DealIDs
StorageMiningSubsystem --> StorageMinerActor: PreCommitSector
StorageMinerActor -->+ StorageMarketActor: VerifyPublishedDealIDs(dealIDs)
StorageMarketActor -->> StorageMarketActor: _assertPublishedDealState
StorageMarketActor -->> StorageMarketActor: _assertDealStartAfterCurrEpoch
StorageMarketActor -->> StorageMarketActor: _assertDealExpireAfterMaxProveCommitWindow
StorageMarketActor -->- StorageMinerActor: Success
StorageMiningSubsystem -->> StorageMinerActor: ProveCommitSector
StorageMinerActor -->+ StorageMarketActor: ActivateDeals(dealIDs)
StorageMarketActor -->> StorageMarketActor: _assertPublishedDealState
StorageMarketActor -->> StorageMarketActor: _assertDealNotYetExpired
StorageMarketActor -->> StorageMarketActor: _activateDeal(publishedDeal)
StorageMarketActor -->- StorageMinerActor: Deals
StorageMinerActor -->> StorageMinerActor: _initializeUtilizationInfo


StorageMinerActor -->> StorageMinerActor: _onSuccessfulPoSt
StorageMinerActor -->> StorageMarketActor: ProcessDealPayment
StorageMarketActor -->> StorageMarketActor: _assertActiveDealState
StorageMarketActor -->> StorageMarketActor: _getStorageFeeSinceLastPayment
StorageMarketActor -->> StorageMarketActor: _transferBalance

StorageMinerActor -->> StorageMinerActor: _submitPowerReport (if any deal expires)
StorageMinerActor -->> StorageMarketActor: ProcessDealExpiration
StorageMarketActor -->> StorageMarketActor: _assertActiveDealState
StorageMarketActor -->> StorageMarketActor: _getStorageFeeSinceLastPayment
StorageMarketActor -->> StorageMarketActor: _transferBalance
StorageMarketActor -->> StorageMarketActor: _unlockCollateral

StorageMinerActor -->> StorageMinerActor: _submitFaultReport(if TerminatedFault)
StorageMinerActor -->> StorageMarketActor: ProcessDealSlash
StorageMarketActor -->> StorageMarketActor: _slashTerminatedFaults
StorageMarketActor -->> StorageMarketActor: _assertActiveDealState
StorageMarketActor -->> StorageMarketActor: _terminateDeal

StorageMinerActor -->+ StorageMarketActor: WithdrawBalance
StorageMarketActor -->- StorageMinerActor: fund